﻿@using TomNet.IMSC.Model.DbModels.Decoration
@{
    Layout = null;
    var um = ViewBag.entity as DecorationRunnings;
}

<!DOCTYPE html>


<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/Css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="~/Content/Css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="~/Content/Css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="~/Content/Css/animate.css" rel="stylesheet">
    <link href="~/Content/Css/style.css?v=4.1.0" rel="stylesheet">
    <title>Insert</title>
    <link href="/Content/Css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="~/Content/common.css" rel="stylesheet">

</head>
<body>
    <div class="wrapper wrapper-content animated fadeInRight">
        <form class="form-horizontal m-t" id="mainForm">

            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label" style="padding-top: 0px;">星标：</label>
                        <div class="col-xs-10" style="padding-top: 4px;">
                            <label style="color:#1cad8f">
                                <input type="radio" id="StarTarget1" name="StarTarget" value="1" @(um.StarTarget == "1" ? "Checked" : "")>客户信用不良
                            </label>
                            <label style="padding-left: 30px;color:#55a2ed;">
                                <input type="radio" id="StarTarget2" name="StarTarget" value="2" @(um.StarTarget == "2" ? "Checked" : "")>客户首付分期
                            </label>
                            <label style="padding-left: 30px;color:#bf163b">
                                <input type="radio" id="StarTarget3" name="StarTarget" value="3" @(um.StarTarget == "3" ? "Checked" : "")>客户全款购买
                            </label>
                            <label style="padding-left: 30px;color:#dc5fce;">
                                <input type="radio" id="StarTarget4" name="StarTarget" value="4" @(um.StarTarget == "4" ? "Checked" : "")>别墅洋房
                            </label>
                            <label style="padding-left: 30px;color:#f1c543;">
                                <input type="radio" id="StarTarget5" name="StarTarget" value="5" @(um.StarTarget == "5" ? "Checked" : "")>其他
                            </label>
                            <label style="padding-left: 30px;">
                                <input type="radio" id="StarTarget0" name="StarTarget" value="0" @(um.StarTarget == "0" ? "Checked" : "")>取消
                            </label>
                        </div>
                    </div>


                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">星标备注：</label>
                        <div class="col-xs-10">
                            <input id="StarTargetRemark" name="StarTargetRemark" type="text" class="form-control" value="@um.StarTargetRemark">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group" style="margin-bottom:0px;">
                        <div class="col-sm-2">

                        </div>
                        <div class="col-sm-10">
                            <button id="submit" class="btn btn-primary pull-right" type="submit">
                                <i class="fa fa-check"></i>&nbsp;提&nbsp;交
                            </button>
                        </div>
                    </div>

                </div>
            </div>
        </form>
    </div>


    <!-- 全局js -->
    <script type="text/javascript" src="~/Scripts/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="~/Scripts/bootstrap.min.js?v=3.3.6"></script>

    <!-- jQuery Validation plugin javascript-->
    <script type="text/javascript" src="~/Scripts/plugins/validate/jquery.validate.min.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/validate/messages_zh.min.js"></script>
    <script type="text/javascript" src="~/Scripts/Extensions/ExtValidator.js"></script>

    <!-- layer javascript -->
    <script type="text/javascript" src="~/Scripts/plugins/layer/layer.min.js"></script>
    <script src="/Scripts/plugins/iCheck/icheck.min.js"></script>

    <script type="text/javascript">
        $(function () {

            var icon = "<i class='fa fa-times-circle'></i> ";
            var validator = $("#mainForm").validate({

                submitHandler: function (form) {
                    $.ajax({
                        url: "/Decoration/DecorationRunnings/EditSetStarTarget",
                        type: "post",
                        dataType: "json",
                        data: GetJsonData(),
                        success: function (data) {
                            //Info,Success,Warning,Error
                            var type = data.type;
                            if (type == 1) {
                                layer.msg(data.content, { icon: 6, time: 2000 },
                                    function () {
                                        var index = parent.layer.getFrameIndex(window.name);
                                        parent.layer.close(index);
                                    });

                            } else {
                                layer.msg(data.content, { icon: 5, time: 2000 });
                            }
                        }
                    });
                }
            });

            function GetJsonData() {
                var Star = $('input:radio:checked').val();
                var Id = @um.Id;
                var json = {
                    "Id":Id,
                    "StarTarget": Star,
                    "StarTargetRemark": $("#StarTargetRemark").val()
                };
                return json;
            }

        });
    </script>
</body>
</html>
